import {defineStore} from "pinia"

const blogStore = defineStore("blogStore", {
    state:()=>{
        return {
            entry:[
                [
                    {
                        uid:"123",
                        title:"文章1",
                        author:"Y",
                        tag:["javascript","web"],
                        date:'2025/4/26 16:39:44',
                        rate:3,
                        discription:"这是文章1"
                    },
                    {
                        uid:"234",
                        title:"文章2",
                        author:"Y",
                        tag:["cpp"],
                        date:'2025/4/26 16:40:45',
                        rate:4,
                        discription:"这是文章2"
                    }
                ]
            ],
            currentPage:1
        }
    },
    getters:{
        currentPageData:state=>state.entry[state.currentPage-1]
    },
    actions:{
        getData(options){
            const {
                tag="",
                page=1,
                size=10,
                data = new Date().toLocaleDateString(),
            } = options;

        }
    }
})

export default blogStore;